using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MahjongDeck
{
    private List<MahjongTile> _pool = new List<MahjongTile>();
    private System.Random _rand = new System.Random();

    public MahjongDeck()
    {
        FillDeck();
    }

    public void FillDeck()
    {
        _pool.Clear();
        // var tileData = _config.Tiles.Values.ToList();
        // for (int i = 0; i < 200; i++) // 无限堆模拟
        // {
        //     var randomTile = tileData[_rand.Next(tileData.Count)];
        //     _pool.Add(new Tile { Data = randomTile });
        // }
    }

    public MahjongTile DrawTile()
    {
        if (_pool.Count == 0) FillDeck();
        var tile = _pool[0];
        _pool.RemoveAt(0);
        return tile;
    }
}

